<template>
    <el-card class="box-card">
    <div slot="header" class="clearfix">
        <span>员工考勤记录表</span>
        <el-button style="float: right;margin-right:15px" type="primary" @click="dialogFormVisible = true">批量导出</el-button>
        <el-button style="float: right;margin-right:15px;margin-left:0" type="primary" @click="nextList">下一月</el-button>
        <el-button style="float: right;margin-right:15px" type="primary" @click="prevList">上一月1</el-button>
    </div>
    <!-- 用户信息列表 -->
   <!-- <div class="app-container">
    <el-table :data="list" v-loading="listLoading" element-loading-text="Loading" border fit highlight-current-row>
      <el-table-column align="center" label='员工ID' width="95">
        <template slot-scope="scope">
          {{scope.$index}}
        </template>
      </el-table-column>
      <el-table-column label="记录">
        <template slot-scope="scope">
          {{scope.row.title}}
        </template>
      </el-table-column>
      <el-table-column label="姓名" width="110" align="center">
        <template slot-scope="scope">
          <span>{{scope.row.author}}</span>
        </template>
      </el-table-column>
      <el-table-column label="基本信息" width="110" align="center">
        <template slot-scope="scope">
          {{scope.row.pageviews}}
        </template>
      </el-table-column>
      <el-table-column class-name="status-col" label="状态" width="110" align="center">
        <template slot-scope="scope">
          <el-tag :type="scope.row.status | statusFilter">{{scope.row.status}}</el-tag>
        </template>
      </el-table-column>
      <el-table-column align="center" prop="created_at" label="截止时间" width="200">
        <template slot-scope="scope">
          <i class="el-icon-time"></i>
          <span>{{scope.row.display_time}}</span>
        </template>
      </el-table-column>
    </el-table>
  </div> -->
  <div class="app-container">
    <el-table :data="list" v-loading="listLoading" element-loading-text="Loading" border fit highlight-current-row>
      <el-table-column align="center" label='序号' width="95">
        <template slot-scope="scope">
          {{scope.$index + 1}}
        </template>
      </el-table-column>
      <el-table-column label="姓名" width="110" align="center">
        <template slot-scope="scope">
          <span>{{scope.row.author}}</span>
        </template>
      </el-table-column>
      <!-- <el-table-column label="记录">
        <template slot-scope="scope">
          {{scope.row.title}}
        </template>
      </el-table-column> -->
      
      <el-table-column label="工作时长" width="110" align="center">
        <template slot-scope="scope">
          {{scope.row.totalWorkTime}}
        </template>
      </el-table-column>
      <el-table-column label="加班时长" width="110" align="center">
        <template slot-scope="scope">
          {{scope.row.totalExtraTime}}
        </template>
      </el-table-column>
      <el-table-column class-name="status-col" label="有无异常记录" width="110" align="center">
        <template slot-scope="scope">
          <el-tag :type="scope.row.status | statusFilter">{{scope.row.status}}</el-tag>
        </template>
      </el-table-column>
      <el-table-column align="center" prop="created_at" label="截止时间" >
        <template slot-scope="scope">
          <i class="el-icon-time"></i>
          <span>{{scope.row.display_time}}</span>
        </template>
      </el-table-column>
    </el-table>
  </div>
  <!-- 添加用户popover -->
  <div class="popForm">
    <el-dialog title="选择导出区间" :visible.sync="dialogFormVisible" center>
    <!-- <el-form :model="form">
        <el-form-item label="活动名称:" :label-width="formLabelWidth">
        <el-input v-model="form.name" auto-complete="off"></el-input>
        </el-form-item>
        <el-form-item label="活动区域:" :label-width="formLabelWidth">
        <el-select v-model="form.region" placeholder="请选择活动区域">
            <el-option label="区域一" value="shanghai"></el-option>
            <el-option label="区域二" value="beijing"></el-option>
        </el-select>
        </el-form-item>
    </el-form> -->
    <div class="container">
      <div class="block">
        <span class="demonstration">选择年:</span>
        <el-date-picker
          v-model="value5"
          type="year"
          :picker-options="pickerOptions1"
          placeholder="选择年">
        </el-date-picker>
      </div>
      <div class="block">
        <span class="demonstration">选择月:</span>
        <el-date-picker
          v-model="value4"
          type="month"
          :picker-options="pickerOptions1"
          placeholder="选择月">
        </el-date-picker>
      </div>
    </div>
    <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible = false">取 消</el-button>
        <el-button type="primary" @click="dialogFormVisible = false">导 出</el-button>
    </div>
    </el-dialog>
    </div>
    </el-card>
    <!--添加用户弹出框 -->
    
    
</template>

<script>
export default {
  data() {
    return {
      pickerOptions1: {
        disabledDate(time) {
          return time.getTime() > Date.now();
        }
      },
      list: [
        
      ],
      listLoading: false,
      dialogFormVisible: false,
      form: {
        name: "",
        region: "",
        date1: "",
        date2: "",
        delivery: false,
        type: [],
        resource: "",
        desc: ""
      },
      formLabelWidth: "120px",
      value4: '',
      value5: ''
    };
  },
  filters: {
    statusFilter(status) {
      const statusMap = {
        "正常": "success",
        draft: "gray",
        "异常": "danger"
      };
      return statusMap[status];
    }
  },
  mounted() {},
  methods: {
    addUser() {},
    prevList() {
      console.log("previos");
    },
    nextList() {
      console.log("next");
    }
  }
};
</script>


<style lang="scss" scoped>
.text {
  font-size: 20px;
}

.item {
  margin-bottom: 18px;
}

.clearfix:before,
.clearfix:after {
  display: table;
  content: "";
}
.clearfix:after {
  clear: both;
}
.clearfix {
  span {
    font-size: 20px;
    line-height: 40px;
  }
}
.box-card {
  margin: 10px;
  .block{
    margin-bottom: 22px;
    .demonstration{
      width: 120px;
      float: left;
      font-weight: bold;
      padding: 0 12px 0 0;
      color: #606266;
      line-height: 40px;
      text-align: right;

    }
  }
}

.app-container {
  padding: 0;
}
</style>
